package com.wjgl.domain;

import java.util.HashSet;
import java.util.Set;

/**
 * Permission entity. @author MyEclipse Persistence Tools
 */

public class Permission implements java.io.Serializable {

	// Fields

	private Integer id;
	private String name;
	private Set roleHasPermissions = new HashSet(0);

	// Constructors

	/** default constructor */
	public Permission() {
	}

	/** minimal constructor */
	public Permission(String name) {
		this.name = name;
	}

	/** full constructor */
	public Permission(String name, Set roleHasPermissions) {
		this.name = name;
		this.roleHasPermissions = roleHasPermissions;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set getRoleHasPermissions() {
		return this.roleHasPermissions;
	}

	public void setRoleHasPermissions(Set roleHasPermissions) {
		this.roleHasPermissions = roleHasPermissions;
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		return this.id==((Permission)obj).getId() && this.name.equals(((Permission)obj).getName());
	}
	

}